﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BDGetQuote.Utilities;
using BDGetQuote.Web.Models;

namespace BDGetQuote.Web.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            if (Session[Constants.SessionUser]==null)
            {
                return RedirectToAction("Index","Login");
            }
            var _user = (UserInfo)Session[Constants.SessionUser];
            if (_user.IsAdmin)
            {
                return RedirectToAction("Index", "Manufacturer");
            }
            return RedirectToAction("Index", "Manufacturer");
        }

    }
}
